module.exports = (app)=> { 

  const DataTypes = app.Sequelize;

  return app.model.define('t_subdevicetype', {
    ts_index: {
      autoIncrement: true,
      type: DataTypes.INTEGER,
      allowNull: false,
      primaryKey: true
    },
    ts_typeid: {
      type: DataTypes.INTEGER,
      allowNull: false
    },
    ts_Maintypeid: {
      type: DataTypes.INTEGER,
      allowNull: false
    },
    ts_TypeMo: {
      type: DataTypes.STRING(60),
      allowNull: false,
      defaultValue: ""
    },
    ts_Icon: {
      type: DataTypes.STRING(60),
      allowNull: false
    }
  }, {
    tableName: 't_subdevicetype',
    timestamps: false,
    underscored: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "ts_index" },
        ]
      },
    ]
  });
};
